package com.ruoyi.gcgl.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gcgl.mapper.GysptMaterialMapper;
import com.ruoyi.gcgl.domain.GysptMaterial;
import com.ruoyi.gcgl.service.IGysptMaterialService;
import com.ruoyi.common.core.text.Convert;

/**
 * 材料规格Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-02
 */
@Service
public class GysptMaterialServiceImpl implements IGysptMaterialService 
{
    @Autowired
    private GysptMaterialMapper gysptMaterialMapper;

    /**
     * 查询材料规格
     * 
     * @param id 材料规格主键
     * @return 材料规格
     */
    @Override
    public GysptMaterial selectGysptMaterialById(Long id)
    {
        return gysptMaterialMapper.selectGysptMaterialById(id);
    }

    /**
     * 查询材料规格列表
     * 
     * @param gysptMaterial 材料规格
     * @return 材料规格
     */
    @Override
    public List<GysptMaterial> selectGysptMaterialList(GysptMaterial gysptMaterial)
    {
        return gysptMaterialMapper.selectGysptMaterialList(gysptMaterial);
    }

    /**
     * 新增材料规格
     * 
     * @param gysptMaterial 材料规格
     * @return 结果
     */
    @Override
    public int insertGysptMaterial(GysptMaterial gysptMaterial)
    {
        return gysptMaterialMapper.insertGysptMaterial(gysptMaterial);
    }

    /**
     * 修改材料规格
     * 
     * @param gysptMaterial 材料规格
     * @return 结果
     */
    @Override
    public int updateGysptMaterial(GysptMaterial gysptMaterial)
    {
        return gysptMaterialMapper.updateGysptMaterial(gysptMaterial);
    }

    /**
     * 批量删除材料规格
     * 
     * @param ids 需要删除的材料规格主键
     * @return 结果
     */
    @Override
    public int deleteGysptMaterialByIds(String ids)
    {
        return gysptMaterialMapper.deleteGysptMaterialByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除材料规格信息
     * 
     * @param id 材料规格主键
     * @return 结果
     */
    @Override
    public int deleteGysptMaterialById(Long id)
    {
        return gysptMaterialMapper.deleteGysptMaterialById(id);
    }

	@Override
	public int updateGysptMaterialByTypebh(GysptMaterial gysptMaterial) {
		return gysptMaterialMapper.updateGysptMaterialByTypebh(gysptMaterial);
	}
}
